from timezones.fields import TimeZoneField

from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _

from base_profiles.models import BaseProfile

class Profile(BaseProfile):
    """ This is where you add your own custom fields 
        What you have already inherited from base_profiles.BaseProfile:

            user = models.ForeignKey(User, unique=True, verbose_name=_('user'))
            name = models.CharField(_('name'), max_length=50, null=True, blank=True)
            about = models.TextField(_('about'), null=True, blank=True)
            location = models.CharField(_('location'), max_length=40, null=True, blank=True)
            website = models.URLField(_('website'), null=True, blank=True, verify_exists=False)        
    """
    pass


def create_profile(sender, instance=None, **kwargs):
    if instance is None:
        return
    profile, created = Profile.objects.get_or_create(user=instance)

post_save.connect(create_profile, sender=User)
